/*
7-127 Sum of the digits
分数 6
作者 翁恺
单位 浙江大学

Given a none-negative number, print out the sum of its digits.
Input Format:

A none-negative integer number.
Output Format:

The sum of its all digits.
Sample Input:

123

Sample Output:

6
*/
#include <stdio.h>

int main() {
    int n;
    scanf("%d", &n);
    int sum = 0;
    for (; n > 0; n /= 10) {
        sum += n % 10;
    }
    printf("%d\n", sum);
    return 0;
}